home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / gnulib / libsrc98.zoo / vfork.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-23  |  797 b   |  38 lines

  1. /*
  2.  * fork(), vfork(): emulate Unix calls. fork() creates a new process with
  3.  * identical (but *not* shared) data space; vfork() does the same, but
  4.  * shares data and stack with the parent. Note that, unlike Unix, the
  5.  * parent is suspended until the child exits. Also note that fork() is
  6.  * usable only if _initial_stack is non-zero, so that the process is
  7.  * doing malloc's from the heap.
  8.  *
  9.  * wait() retrieves the exit status and pid of children created by
  10.  * fork.
  11.  *
  12.  * see fork.c for _fork() and _wait().
  13.  *
  14.  * written by Eric R. Smith and placed in the public domain.
  15.  * use at your own risk.
  16.  */
  17.  
  18. #include "fork.h"
  19.  
  20. int fork()
  21. {
  22.     return _fork((char *)0);
  23. }
  24.  
  25. int
  26. vfork(dummy)
  27. int dummy;
  28. {
  29.     return _fork((char *)&dummy);
  30. }
  31.  
  32. int
  33. wait(exit_code)
  34. int *exit_code;
  35. {
  36.     return _wait(exit_code);
  37. }
  38.